 package com.oanda.blackberry.restapi;
 
 public class TradePollResponse
 {
   long[] closed;
   long[] updated;
   long[] opened;
   long maxTradeId;
 
   public TradePollResponse()
   {
   }
 
   public TradePollResponse(long[] closed, long[] updated, long[] opened, long maxTradeId)
   {
     this.closed = closed;
     this.updated = updated;
     this.opened = opened;
     this.maxTradeId = maxTradeId;
   }
 
   public long[] getClosed() {
     return this.closed;
   }
 
   public long getMaxTradeId() {
     return this.maxTradeId;
   }
 
   public long[] getOpened() {
     return this.opened;
   }
 
   public long[] getUpdated() {
     return this.updated;
   }
 
   public void setClosed(long[] closed) {
     this.closed = closed;
   }
 
   public void setMaxTradeId(long maxTradeId) {
     this.maxTradeId = maxTradeId;
   }
 
   public void setOpened(long[] opened) {
     this.opened = opened;
   }
 
   public void setUpdated(long[] updated) {
     this.updated = updated;
   }
 
   public long getMaxOpenedId() {
     long max = 0L;
     for (int i = 0; (this.opened != null) && (i < this.opened.length); i++) {
       if (max < this.opened[i]) {
         max = this.opened[i];
       }
     }
     return max;
   }
 
   public String getAllUpdatedIds() {
     StringBuffer buffer = new StringBuffer();
     for (int i = 0; (this.updated != null) && (i < this.updated.length); i++) {
       buffer.append(Long.toString(this.updated[i]));
       buffer.append(',');
     }
 
     if (buffer.length() > 1) {
       buffer = buffer.deleteCharAt(buffer.length() - 1);
     }
 
     return buffer.toString();
   }
}

